Arribos CA
Paleta1
read_csv("GSB_Landings.csv", col_types = cols()) %>%
gather(Procedencia, Captura, -Year) %>%
ggplot(aes(x = Year, y = Captura, color = Procedencia)) +
geom_line(size = 1.1) +
theme_classic() +
theme(legend.justification = c(0.5, 0.5),
legend.position = c(0.7, 0.7),
text = element_text(family = "Raleway", size = 18)) +
scale_color_manual(values = pal1) +
labs(x = "Año", y = "Arribos (Toneladas)") +
scale_x_continuous(breaks = seq(1920, 2010, 10), minor_breaks = NULL) +
scale_y_continuous(breaks = seq(0, 375, 75), minor_breaks = NULL)

ggsave("Paleta1.tiff", dpi = 600, width = 16, height = 8)
Paleta 2
read_csv("GSB_Landings.csv", col_types = cols()) %>%
gather(Procedencia, Captura, -Year) %>%
ggplot(aes(x = Year, y = Captura, color = Procedencia)) +
geom_line(size = 1.1) +
theme_classic() +
theme(legend.justification = c(0.5, 0.5),
legend.position = c(0.7, 0.7),
text = element_text(family = "Raleway", size = 20)) +
scale_color_manual(values = pal2) +
labs(x = "Año", y = "Arribos comerciales de Mero Gigante en California \n(Toneladas)") +
scale_x_continuous(breaks = seq(1920, 2010, 10), minor_breaks = NULL) +
scale_y_continuous(breaks = seq(0, 375, 75), minor_breaks = NULL)

ggsave("Paleta2.tiff", dpi = 600, width = 16, height = 8)
Paleta 1 animada
plot_data <- read_csv("GSB_Landings.csv", col_types = cols()) %>%
gather(Procedencia, Arribos, -Year) %>%
mutate(ease = "linear", x = Year) %>%
rename(y = Arribos, id = Procedencia, time = Year)
tween_plot <- plot_data %>%
tween_elements(., "time", "id", "ease", nframes = 250) %>% #using tweenr!
mutate(year = round(time), id = .group) %>%
left_join(plot_data, by = c("time", "y", "x", "id")) %>%
rename(Procedencia = id) %>%
ggplot(aes(x = x, y = y, frame = .frame, color = Procedencia)) +
geom_path(aes(group = Procedencia, cumulative = T), size = 1.1) +
theme_classic() +
theme(legend.justification = c(0.5, 0.5),
legend.position = c(0.7, 0.7),
text = element_text(family = "Raleway", size = 18)) +
scale_color_manual(values = pal1) +
labs(x = "Año", y = "Arribos (Toneladas)") +
scale_x_continuous(breaks = seq(1920, 2010, 10), minor_breaks = NULL) +
scale_y_continuous(breaks = seq(0, 375, 75), minor_breaks = NULL)
Column `id` joining factor and character vector, coercing into character vectorIgnoring unknown aesthetics: cumulative
gganimate(tween_plot, title_frame = FALSE, interval = 0.001, "Landings_CA.gif", ani.width = 800, ani.height = 500)
Arribos Mexico
read_csv("GSB_Landings_mx.csv", col_types = cols()) %>%
ggplot(aes(x = Ano, y = Arribos)) +
geom_line(size = 1.1, color = "#357c57") +
geom_point(size = 2, color = "#357c57") +
theme_classic() +
theme(legend.justification = c(0.5, 0.5),
legend.position = c(0.7, 0.7),
text = element_text(family = "Raleway", size = 20)) +
labs(x = "Año", y = "Arribos comerciales de Mero Gigante \n(Toneladas)")
ggsave("Mex.tiff", dpi = 600, width = 16, height = 8)
